package com.dawn.module.hospital.dal.mysql.msgsenduser;

import java.util.*;

import com.dawn.framework.common.pojo.PageResult;
import com.dawn.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.dawn.framework.mybatis.core.mapper.BaseMapperX;
import com.dawn.module.hospital.dal.dataobject.msgsenduser.MsgSendUserDO;
import org.apache.ibatis.annotations.Mapper;
import com.dawn.module.hospital.controller.admin.msgsenduser.vo.*;

/**
 * 消息推送用户 Mapper
 *
 * @author root
 */
@Mapper
public interface MsgSendUserMapper extends BaseMapperX<MsgSendUserDO> {

    default PageResult<MsgSendUserDO> selectPage(MsgSendUserPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MsgSendUserDO>()
                .eqIfPresent(MsgSendUserDO::getAppId, reqVO.getAppId())
                .likeIfPresent(MsgSendUserDO::getAppName, reqVO.getAppName())
                .eqIfPresent(MsgSendUserDO::getAppType, reqVO.getAppType())
                .likeIfPresent(MsgSendUserDO::getUsername, reqVO.getUsername())
                .eqIfPresent(MsgSendUserDO::getOpenid, reqVO.getOpenid())
                .eqIfPresent(MsgSendUserDO::getPhone, reqVO.getPhone())
                .eqIfPresent(MsgSendUserDO::getSendType, reqVO.getSendType())
                .likeIfPresent(MsgSendUserDO::getSendName, reqVO.getSendName())
                .eqIfPresent(MsgSendUserDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(MsgSendUserDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MsgSendUserDO::getId));
    }

}